home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor1
/
stack.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
2KB
|
37 lines
Author: Jake Schwartz; comments by Joe Horn.
Suppose we want to show 6 levels of the stack instead of just the normal 4.
Jake Schwartz wrote this one, called 'STACK':
<<
"6: " @ initial 21-character string for line 6
IF DEPTH 7 >= @ if stack level 6 exists
THEN 7 PICK ->STR @ get it and convert to a string
ELSE "" @ otherwise use a null string
END 23 OVER SIZE @ get size of object string
- 3 MAX SWAP REPL 1 @ position it right-justified in display string
DISP @ display in line one of LCD
"5: " @ -- repeat
IF DEPTH 6 >= @ the same
THEN 6 PICK ->STR @ process
ELSE "" @ for
END 23 OVER SIZE @ stack
- 3 MAX SWAP REPL 2 @ level 5 --
DISP 1 FREEZE @ and freeze the status area of the LCD
>>
Now, save this as 'STACK', and save << DROP STACK >> as 'betaENTER'. (The
beta character can be obtained by pressing [blue][B] in alpha mode.) Then,
whenever you're in user mode with flag -63 set, you'll see a six-level
stack automatically after all operations! Notice that non-operation keys,
such as ATTN, the shift keys, and menu keys restore the normal display.
Of course, if you prefer, you may run STACK directly rather than using the
vectored enter method described above.
Note well that STACK is not really a replacement for the normal 4-high stack
display; it blows away the user's LASTARGs.
[Note: This program is obsoleted by an assembly-language version called
ALTD. Try it; you'll like it! -jkh-]